#ifndef USER_HH_
# define USER_HH_
# include "World.hh"
# include "Galaxy.hh"
# include "Player.hh"
# include <QtCore>
# include <boost/noncopyable.hpp>

class World::User: boost::noncopyable {
    protected: typedef QMap< QString, spUser > UserMap;

    protected: typedef QMap< pGalaxy, spPlayer > PlayerMap;

    protected: static UserMap users;

    protected: static QMutex staticLock;

    public:
    static spUser construct(QString const& name, QString const& password);
    public: static void destruct(QString const& name);
    public: static void destruct_all();
    public: static spUser select(QString const& name);

    protected: QMutex lock;

    public: QString const name;

    protected: QString password;

    protected: User(QString const& name, QString const& password);

    public: void destruct();

    public: QString get_name();
    public: void set_password(QString const& newPassword);

};

#endif // ndef USER_HH_
